package cn.edu.sptc.fanjing.hellospring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class JsonController {
    @GetMapping("/Json")
    @ResponseBody
//    类名首字母大写，方法名首字母小写
    public String helloWorld
            (@RequestParam(value = "name",required = true,defaultValue = "Json")
             String name){
        return "Hello world "+name+" !";
    }
}
